使用Ant Design Upload组件,实现文件随表单一起提交
拦截文件上传
方法1:beforeUpload拦截
1 | <Upload |
1 | const beforeUpload = |
方法2:customRequest拦截
1 | <Upload |
1 | const beforeUpload = |
formData 上传文件
1 | // 注意不要手动设置请求头 Content-Type:multipart/form-data |
视界之外,想象之中
使用Ant Design Upload组件,实现文件随表单一起提交
1 | <Upload |
1 | const beforeUpload = |
1 | <Upload |
1 | const beforeUpload = |
1 | // 注意不要手动设置请求头 Content-Type:multipart/form-data |